package day2017_10_08;

/**
 * Created by 婷婷 on 2017/10/9.
 */
public class TestStudent {

    //定义一个main方法
    public static void main(String[] args) {
        TestStudent stu=new TestStudent("冷婷婷","女",20,150);
        //调用函数
        stu.printInfo();
    }
    //设置成员变量
    String name;
    String sex;
    int age;
    double score;
    //构造一个有参函数，并对参数赋值
    public  TestStudent(String name,String sex, int age, double score) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.score = score;
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String name) {
        this.name = sex;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public double getScore() {
            return score;
    }
    public void setScore(double score) {
        this.score = score;
    }

    //定义一个输出打印的函数
    public void printInfo()
    {
        System.out.println("学生的姓名是:"+name);
        System.out.println("学生的性别是:"+sex);
        System.out.println("学生的年龄是:"+age);
        System.out.println("学生的分数是:"+score);
    }
}




